<div class="layui-row">
    {if $leve}
    <div class="layui-col-xs2">
        <a href="{:url('index')}?folder={$uppath}"><img src="/static/common/img/upback.gif"></a>
        <b><font color="#665aff">返回上一级</font></b>
    </div>
    {/if}
    <!--展示文件夹-->
    {volist name='folders' id='folders'}
    <div class="layui-col-xs2">
        <a href="{:url('index')}?folder={$folder}{$folders['filename']}/">
            <img src="/static/common/img/folder.gif">
        </a>
        <b>{$folders.filename}</b>
        <em>
            <a href="javascript:confirm_delete('{$folder}','{$folders.filename}')">删除</a>
        </em>
    </div>
    {/volist}
    <!--展示文件-->
    {volist name='files' id='files'}
    <div class="layui-col-xs2">
        <a href="{$files.filepath}" target="_blank">
            <img width="50px" height="50px" src="{$files.filepath}">
        </a>
        <b>{$files.filename}</b>
        <em><a href="javascript:confirm_delete('{$folder}','{$files.filename}')">删除</a></em>
    </div>
    {/volist}
</div>

<script>
    //删除
    function confirm_delete(folder,filename) {
        ybLayer.confirm('确认要删除么?删除后不可恢复', function(index){
            ybLayer.close(index);
            ajaxPost("{:url('del')}",{'folder': folder,'filename': filename},function(res){
                ybLayer.msg(res.msg,{icon: 6});
                setTimeout(function () {
                    window.location.reload();
                }, 1000);
            },function(res){
                ybLayer.msg(res.msg,{icon: 5});
            })
        });
    }
</script>